import React from "react";
import { useTranslation } from "react-i18next";

export default function App() {
  let { t, i18n } = useTranslation();
  return (
    <>
      <button
        onClick={() => {
          i18n.changeLanguage("zh");
        }}
      >
        中文
      </button>
      <button
        onClick={() => {
          i18n.changeLanguage("en");
        }}
      >
        英文
      </button>
      <div>{t("test:cancel")}</div>
      <div>{t("test:ok")}</div>
    </>
  );
}
